let str='大海星辰,星辰大海'
console.log(str.replaceAll('星辰','满眼星辰'))
// "大海满眼星辰,满眼星辰大海"
const addRemote = async (a, b) => new Promise((resolve, reject) => {
	setTimeout(() => resolve(a + b), 3000)
})
const addRemote2 = async (a, b) => new Promise((resolve, reject) => {
	setTimeout(() => reject(), 1000)
})
let promise1 = addRemote(1, 2)
let promise2 = addRemote2(1, 3)
let promise3 = addRemote2(1, 4)
let values=[promise1, promise2, promise3];
Promise.any(values).then(res => {
	console.log(res, 'any--成功')
}).catch(err => {
	console.log(err, 'any--失败')
})
Promise.all(values).then(res => {
	console.log(res, 'all--成功')
}).catch(err => {
	console.log(err, 'all--失败')
})
Promise.race(values).then(res => {
	console.log(res, 'race--成功')
}).catch(err => {
	console.log(err, 'race--失败')
})
let a,b=100;
console.log(a||=b);  //a=a||b;   等价于：if(a== 0|| a === "" ||a=== false ||a === null ||a=== undefined){a=b}
console.log(a&&=b); // a=a&&b;  等价于： if(a) {a=b}
console.log(a??=b); //a=a??b ； 等价于：   if(a===null||a===undefined){a=b}
